#include <iostream>
#include <string>
#include <map>

using namespace std;

int main(int argc, char *argv[])
{
	map<char, string> seven;
	seven.insert(map<char, string>::value_type(' ', "%20"));
	seven.insert(map<char, string>::value_type('!', "%21"));
	seven.insert(map<char, string>::value_type('$', "%24"));
	seven.insert(map<char, string>::value_type('%', "%25"));
	seven.insert(map<char, string>::value_type('(', "%28"));
	seven.insert(map<char, string>::value_type(')', "%29"));
	seven.insert(map<char, string>::value_type('*', "%2a"));
	map<char, string>::iterator iter;

	string line, result;
	getline(cin, line);
	while (line.length() != 1 || line[0] != '#') {
		result.clear();
		for (int i = 0; i < (int)line.length(); ++i)
		{
			iter = seven.find(line[i]);
			if (iter != seven.end()) {
				result.insert(result.length(), (*iter).second);
			} else {
				result.append(1, line[i]);
			}
		}
		cout<<result<<endl;
		getline(cin, line);
	}
	return 0;
}